//
//  Common.h
//  LehuiCity
//
//  Created by XJLH on 13-4-1.
//  Copyright (c) 2013年 iXujia. All rights reserved.
//


#define PERSONALIMFORMATIONPATH [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]

#pragma mark -正式与测试环境

//正式
#define HOSTURL @"http://szb.our100.net/Server/default.aspx"
#define PICPERFIXURL @"http://file.our100.net/images.aspx?fileid="
#define REQUESTIMAGEURL @"http://file.our100.net"
#define REQUESTPLAYER @"http://file.our100.net/images.aspx?fileid="

//

//测试
//#define HOSTURL @"http://szb.e-shiyun.com/Server/default.aspx"
//#define PICPERFIXURL @"http://file.e-shiyun.com/images.aspx?fileid="
//#define REQUESTIMAGEURL @"http://file.e-shiyun.com"
//#define REQUESTPLAYER @"http://file.e-shiyun.com/images.aspx?fileid="

#define APP_PASS            @"S#%840B1FZ5#%79B#%9"

#define VERSIONCODE @"师云少智版 V1.0.1"
#define KNOTIFICATION_LOGINCHANGE @"loginStateChange"
#define IMAGEHOSTURL [NSString stringWithFormat:@"%@/images.aspx?fileid=",REQUESTIMAGEURL]
#define SUBMITIMAGEURL [NSString stringWithFormat:@"%@/imgdb.asmx",REQUESTIMAGEURL]
#define SOAPSTRING(action) [NSString stringWithFormat:@"%@/imgdb/%@",REQUESTIMAGEURL,action]
#define ISLOGIN [[NSUserDefaults standardUserDefaults] objectForKey:@"isLogin"]
#define KeyWindow [UIApplication sharedApplication].keyWindow;
#define USERID [[NSUserDefaults standardUserDefaults] objectForKey:@"userid"]
#define TOKEN  [[NSUserDefaults standardUserDefaults] objectForKey:@"token"]
#define CONSTAPPDELEGATE (AppDelegate *)[[UIApplication sharedApplication] delegate]

#define AppStoreInfoLocalFilePath [NSString stringWithFormat:@"%@/%@/", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject],@"EACEF35FE363A75A"]


typedef NS_ENUM(NSInteger, ManageType) {
    ManageTypeStudent = 0,
    ManageTypeTeacher = 1,
    ManageTypeParent = 2,
};

#define BTNCOLOR [UIColor colorWithRed:122.0f/255.0f green:126.0f/255.0f blue:220.0f/255.0f alpha:1.0f]
#define RGBCOLOR(r, g, b)   [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]

#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]


#define SCREENWIDTH  ([UIScreen mainScreen].bounds.size.width)
#define SCREENHEIGH  ([UIScreen mainScreen].bounds.size.height)
#define IPHONEX (SCREENHEIGH == 812.0)
#define SafeAreaBottomHeight (SCREENHEIGH == 812.0 ? 34 : 0)
#define SafeAreaTopHeight (SCREENHEIGH == 812.0 ? 88 : 64)

#define VIEW_WIDTH self.view.frame.size.width
#define VIEW_HEIGHT self.view.frame.size.height
#define LINECOLOR RGBCOLOR(199, 199, 204)
#define TABLEHEADERBGCOLOR RGBCOLOR(240,239,245)
#define DEFAULTCOLOR colorFromHex(@"#fb524a")


//适配
#define iOS7_or_Later ([[UIDevice currentDevice] systemVersion].floatValue >= 7.0 ? YES : NO)
#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES)
#define XZHEIGHT(h) (h) * SCREENWIDTH /320


#define kAppId  [[NSBundle mainBundle] objectForInfoDictionaryKey:@"appId"]//应用在苹果商店的id
#define kiTunesAdd @"http://https://itunes.apple.com/cn/app//idAPP_ID?mt=8"
#define kiTunesRequest @"http://itunes.apple.com/lookup?id=APP_ID"
#define WEIBO_URL [[NSBundle mainBundle] objectForInfoDictionaryKey:@"weibo"]


#define APP_SCHEME  (NSString*)[[[[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleURLTypes"] objectAtIndex:0] objectForKey:@"CFBundleURLSchemes"] objectAtIndex:0]


//用户相关
#define XZHEADURL @"XZheadUrl"
#define SYISFirstLogin @"syisfirstLogin"

#define SYTypeNewFunc @"sytypeNewFunc"

#define kSDKUsername   @"username"

//分享相关
#define QQAPPID @"1105704647"
#define QQAPPSECRECT @"l70X6XZ32fOInRbS"
#define WECHATAPPID @"wxfa01b0c9baac67a5"
#define WECHATSECRECT @"e116b996063ef5db04fb15bd3faed380"
#define NORECEIVE @"noceive"


